package com.bj58.ecdata.dashboard.constant;

import java.util.List;
import java.util.Map;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.google.common.collect.Maps;


public final class ResumeConst {
	public static final Map<String, List<Object>> resumeCrowdMap = Maps.newHashMap();
	static{
		resumeCrowdMap.put("education",JSONArray.parseArray("['高中','大专','本科','中专或技校']"));
		resumeCrowdMap.put("salary",JSONArray.parseArray("['面议','2000-3000','3000-5000','5000-8000']"));
		resumeCrowdMap.put("work_years",JSONArray.parseArray("['1~2年','3~5年','6~7年','1年以下','其他']"));
	}
	//直销城市和top20类别
	public static final  JSONArray CityList= JSON.parseArray("['北京', '成都', '重庆', '石家庄', '济南', '青岛', '南京', '杭州', '苏州', '无锡', '合肥', '武汉', '郑州', '长沙', '福州', '厦门', '南宁', '哈尔滨', '长春', '太原', '大连', '沈阳', '上海', '天津', '广州', '深圳', '东莞']");
	public static final  JSONArray CateList= JSON.parseArray("['人事/行政/后勤','餐饮','销售','超市/百货/零售','普工/技工','司机','物流/仓储','客服','财务/审计/统计','教育培训','建筑','淘宝职位','家政保洁/安保','酒店/旅游','计算机/互联网/通信','娱乐/休闲','美术/设计/创意','美容/美发','医院/医疗/护理','贸易/采购']");
	

	public static final String[] resume_Array={"PC_resume","M_resume","APP_resume","PCW_resume","MW_resume","APPW_resume"};
	public static final String[] user_Array={"PC_user","M_user","APP_user","PCW_user","MW_user","APPW_user"};
	
	/**
	 * 获取简历整体数据查询列--折线图
	 */
	private static final String Resume_COLS_PTN = "stat_date,PC_resume, M_resume,APP_resume, PCW_resume, MW_resume, APPW_resume";
	private static final String Resume_CON_PTN = "cate_name='%s' AND city_name='%s'";

	private static final String User_COLS_PTN = "stat_date,PC_user, M_user,APP_user, PCW_user, MW_user, APPW_user";
	
	public static String getLineCols(String index) {
	
		if(index.equals("resume_add_count"))
			return Resume_COLS_PTN;
		else                  // if(index.equals("user_add_count"))
			return User_COLS_PTN;
	}

	public static String getLineCon(String cate,String city) {
		return String.format(Resume_CON_PTN, cate,city);
	}
	
	/**
	 * 获取简历整体数据查询列--饼图
	 */
	private static final String Resume_pie_COLS_PTN = "month_num,SUM(PC_resume) as PC_resume, SUM(M_resume) as M_resume, SUM(APP_resume) as APP_resume,SUM(PCW_resume) as PCW_resume, SUM(MW_resume) as MW_resume, SUM(APPW_resume) as APPW_resume";
	private static final String Resume_pie_CON_PTN = "cate_name='%s' AND city_name='%s' group by month_num";

	private static final String User_pie_COLS_PTN = "month_num,SUM(PC_user) as PC_user, SUM(M_user) as M_user, SUM(APP_user) as APP_user,SUM(PCW_user) as PCW_user, SUM(MW_user) as MW_user, SUM(APPW_user) as APPW_user";
	
	
	public static String getPieCols(String index) {
		
		if(index.equals("resume_add_count"))
			return Resume_pie_COLS_PTN;
		else                            // if(index.equals("user_add_count"))
			return User_pie_COLS_PTN;
	}

	public static String getPieCon(String cate,String city) {
		return String.format(Resume_pie_CON_PTN, cate,city);
	}
	
	
	public static final String[] platform_Array={"PC","M","APP","抓取","其他"};
	
	/**
	 * 获取职位整体数据查询列--饼图
	 */
	private static final String Job_pie_COLS_PTN =  "month_num,platform,SUM(add_position) as add_position,SUM(add_position_ent) as add_position_ent";
	private static final String Job_pie_CON_PTN = "cate_name='%s' AND city_name='%s' group by month_num,platform";
	
	public static String getJobPieCols() {
			return Job_pie_COLS_PTN;
	}

	public static String getJobPieCon(String cate,String city) {
		return String.format(Job_pie_CON_PTN, cate,city);
	}
	
	/**
	 * 获取职位整体数据查询列--折线图
	 */
	private static final String Job_COLS_PTN = "stat_date, platform, add_position, add_position_ent";
	private static final String Job_CON_PTN = "cate_name='%s' AND city_name='%s' group by stat_date,platform";
	
	public static String getJobLineCols() {
			return Job_COLS_PTN;
	}

	public static String getJobLineCon(String cate,String city) {
		return String.format(Job_CON_PTN, cate,city);
	}
	
	/**
	 * 对应表t_resume_board_ind_total字段    
	 * 
	 */
	public static String getName(String name) {
		String ZW="";
		if(name.equals("PC_resume"))
			ZW= "PC简历";
		else if(name.equals("M_resume"))
			ZW= "M简历";
		else if(name.equals("APP_resume"))
			ZW= "APP简历";
		else if(name.equals("PCW_resume"))
			ZW= "PC微简历";
		else if(name.equals("MW_resume"))
			ZW= "M微简历";
		else if(name.equals("APPW_resume"))
			ZW= "APP微简历";
		else if(name.equals("PC_user"))
			ZW= "PC简历人数";
		else if(name.equals("M_user"))
			ZW= "M简历人数";
		else if(name.equals("APP_user"))
			ZW= "APP简历人数";
		else if(name.equals("PCW_user"))
			ZW= "PC微简历人数";
		else if(name.equals("MW_user"))
			ZW= "M微简历人数";
		else if(name.equals("APPW_user"))
			ZW= "APP微简历人数";
		return ZW;
	}
	
	//简历销售收入
	public static final Map<String, List<Object>> resumeIncomeMap = Maps.newHashMap();
	static{
		resumeIncomeMap.put("用户类型",JSONArray.parseArray("['会员','非会员']"));
		resumeIncomeMap.put("用户情况",JSONArray.parseArray("['新用户','老用户']"));
		resumeIncomeMap.put("购买平台",JSONArray.parseArray("['pc','微信','m','帮帮','招聘商家版']"));
		resumeIncomeMap.put("简历包规格",JSONArray.parseArray("['1','5','10','20','50','100','其他']"));
	}


}
